#!/bin/bash

export basepath=$(readlink -f $(dirname $0))

##docker network create --driver bridge --subnet 172.18.0.0/24 --gateway 172.18.0.1 mynet
docker pull nacos/nacos-mysql:8.0.16
docker run -d --name mysql_nacos --restart=always \
-p 3301:3306 \
-v /opt/docker/mysql:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=testYnlcom \
-e MYSQL_DATABASE=nacos_devtest \
-e MYSQL_USER=nacos \
-e MYSQL_PASSWORD=nacos123 \
nacos/nacos-mysql:8.0.16

##初始化脚本
##https://github.com/alibaba/nacos/blob/develop/distribution/conf/nacos-mysql.sql

##会内置下面两条信息,nacos/nacos
##INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
##INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');

##--ip 172.18.0.20 \